package com.djinfo.work.controller;

import com.djinfo.work.common.bean.AjaxJson;
import com.djinfo.work.common.util.StringUtil;
import com.djinfo.work.entity.QsQuestionEntity;
import com.djinfo.work.entity.QsResultEntity;
import com.djinfo.work.entity.QsUserEntity;
import com.djinfo.work.service.QsQuestionService;
import com.djinfo.work.service.QsResultService;
import com.djinfo.work.service.QsUserService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * Created by admin on 2017/6/13.
 */
@Controller
@RequestMapping("/QsResult")
public class QsResultController {

    private static final Log log = LogFactory.getLog(QsResultController.class);
    @Autowired
    private QsResultService qsResultService;
    @Autowired
    private QsQuestionService questionService;
    @Autowired
    private QsUserService qsUserService;

    /**
     * 标题列表
     */
    @RequestMapping("/list.do")
    @ResponseBody
    public AjaxJson list(QsResultEntity qsResultEntity, Integer pagenum, Integer pagesize){
        AjaxJson ajaxJson=qsResultService.list(qsResultEntity,pagenum,pagesize);
        return ajaxJson;
    }
   /* *//**
     * 新增修改操作
     *//*
    @RequestMapping("/saveOrUpdate.do")
    @ResponseBody
    public void addOrUpdate(QsResultEntity qsResultEntity){
        String nowTime=StringUtil.getNowTime();
        if(qsResultEntity.getId()==null||"".equals(qsResultEntity.getId())){
            qsResultEntity.setId(null);
            qsResultEntity.setCreateTime(nowTime);
            qsResultEntity.setUpdateTime(nowTime);
            qsResultService.save(qsResultEntity);
        }else{
            qsResultEntity.setUpdateTime(nowTime);
            qsResultService.update(qsResultEntity);
        }

    }*/


}
